// Copyright (c) 2009-2015 Intel Corporation
// All rights reserved.
//
// WARRANTY DISCLAIMER
//
// THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
// MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Intel Corporation is the author of the Materials, and requests that all
// problem reports or change requests be submitted to it directly

// OpenCL kernel to perform an element-wise addition

kernel void drawBox_Y( __write_only image2d_t output, int top, int left, float fDimmerSwitch)
{
       int x = get_global_id(0)+left;
       int y = get_global_id(1)+top;


       int xMin = 0, xMax = 1, yMin = 0, yMax = 1;

       {      
              write_imagef(output, (int2)(x, y), (float4)(fDimmerSwitch, 0.f, 0.f, 1.f));
       }
}


kernel void drawBox_UV( __write_only image2d_t output, int top, int left,float fDimmerSwitch)
{
       int x = get_global_id(0)+left/2;
       int y = get_global_id(1)+top/2;

       fDimmerSwitch = 128.0f;

       int xMin = 0, xMax = 1, yMin = 0, yMax = 1;

       {      
              write_imagef(output, (int2)(x, y), (float4)(0.5f, 0.5f, 0.f, 1.f));
       }
}

